package com.framework.tomcat.ex03.pyrmont.shutdownhook;

/**
 * @author LIN
 * @date 2022-09-03 21:44
 */
public class ShutdownHookDemo {

    public void start(){
        System.out.println("Demo");
        ShutdownHook shutdownHook = new ShutdownHook();
        Runtime.getRuntime().addShutdownHook(shutdownHook);

    }

    public static void main(String[] args) {
        ShutdownHookDemo shutdownHookDemo = new ShutdownHookDemo();
        shutdownHookDemo.start();
        try{
            System.in.read();
        }catch(Exception e){
            e.printStackTrace();
        }
    }

}
class ShutdownHook extends Thread{

    @Override
    public void run(){
        System.out.println("Shutting down");
    }
}
